[#escape x as x?html]
<!DOCTYPE html>
<html>
<head>
    [#include "/include/meta.ftl" /]
    [#include "/include/css.ftl" /]
    <title>文章列表</title>
    [#include "/include/js.ftl" /]
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

    <div class="content-wrapper margin-left0">
        [#assign firstNavName="文章"]
        [#assign secondNavName="新增"]
        [#include "/include/contentHeader.ftl" /]

        <section class="content">
            <div class="box box-success">
                <form id="form" action="save" method="post" class="form-horizontal">
                    <input type="hidden" name="fileId" id="fileId">
                    <input type="hidden" name="articleClassIds" id="articleClassIds">
                    <input type="hidden" name="contentHtml" id="contentHtml">
                    <input type="hidden" name="contentText" id="contentText">
                    <div class="box-body">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">标题</label>
                            <div class="col-sm-6">
                                <input type="text" name="title" class="form-control" placeholder="标题">
                            </div>
                        </div>
                    </div>
                    <div class="box-body">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">作者</label>
                            <div class="col-sm-6">
                                <input type="text" name="author" class="form-control" placeholder="作者">
                            </div>
                        </div>
                    </div>

                    <div class="box-body">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">分类</label>
                            <div class="col-sm-6">
                                <div class="checkbox">
                                    [#list articleClasses as articleClass]
                                        <label>
                                            <input name="articleClassId" type="checkbox" value="${articleClass.id}">
                                        ${articleClass.name}
                                        </label>
                                    [/#list]
                                </div>
                            [#--<div class="checkbox">
                                                         <label>
                                                             <input type="checkbox" disabled="">
                                                             Checkbox disabled
                                                         </label>
                                                     </div>--]
                            </div>
                        </div>
                    </div>

                    <div class="box-body">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">主图</label>
                            <div class="col-sm-6" id="uploadFile">
                                <input type="file" name="file" id="mainPic"
                                       accept="image/jpg,image/jpeg,image/png,image/gif">
                            </div>
                        </div>
                        <div class="form-group" id="uploadedFile">
                            <label class="col-sm-2 control-label">预览</label>
                            <div class="col-sm-5">
                                <img id="imgContent" width="400px"/>
                            </div>
                            <div class="col-sm-1">
                                <button id="deletePhoto" type="button"
                                        class="btn btn-block btn-danger" style="display: none;">删除照片
                                </button>
                            </div>
                        </div>
                    </div>

                    <div class="box-body">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">是否显示</label>
                            <div class="col-sm-6">
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="display" value="true" checked="">是
                                    </label>
                                    &nbsp;&nbsp;
                                    <label>
                                        <input type="radio" name="display" value="false">否
                                    </label>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="box-body">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">是否置顶</label>
                            <div class="col-sm-6">
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="top" value="true">是
                                    </label>
                                    &nbsp;&nbsp;
                                    <label>
                                        <input type="radio" name="top" value="false" checked="">否
                                    </label>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="box-body">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">文章状态</label>
                            <div class="col-sm-6">
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="status" value="-1">已删除
                                    </label>
                                    &nbsp;&nbsp;
                                    <label>
                                        <input type="radio" name="status" value="1">草稿
                                    </label>
                                    &nbsp;&nbsp;
                                    <label>
                                        <input type="radio" name="status" value="0" checked="">发布
                                    </label>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="box-body">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">文章详情</label>
                            <div class="col-sm-10">
                                <!-- 加载编辑器的容器 -->
                                <script id="editor" type="text/plain" name="content" >
                                </script>
                            </div>
                        </div>

                    </div>

                    <div class="box-footer">
                        <div class="row">
                            <div class="col-sm-offset-2">
                                <button id="btnSubmit"  type="button" class="btn btn-primary">保存</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </section>
    </div>

</div>
<!-- ./wrapper -->
<script type="text/javascript">
	window.UEDITOR_HOME_URL = _base + '/resource/public/plugin/ueditor/';
    require(['admin/js/article/add', 'jquery'], function (Page, $) {
        Page.main();
    });
</script>
</body>
</html>
[/#escape]
